﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Freedback.Core.Entities;
using System.Linq.Expressions;

namespace Freedback.Core.Repositories
{
    public interface IGenericRepository
    {
        IEnumerable<T> GetAll<T>() where T : class, IEntity;
        T Get<T>(object id) where T : class, IEntity;
        T Get<T>(Expression<Func<T, bool>> predicate, params Expression<Func<T, object>>[] associations) where T : class;
        T Get<T>(int id) where T : class, IEntity;
        T Get<T>(int id, params Expression<Func<T, object>>[] associations) where T : class, IEntity;

        void Add<T>(T entity) where T : class, IEntity;
        void Delete<T>(int id) where T : class, IEntity;
    }
}
